home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d18
/
tpa2_a.arc
/
README.NEW
< prev
next >
Wrap
Text File
|
1991-04-28
|
7KB
|
158 lines
TP&Asm Integrated Compile-Time Assembler Version 2 ß
TP&Asm-M Memory Mode Assembly Language Development Tool Version 2 ß
Copyright (c) 1989 Richard W. Prescott
All Rights Reserved
═══════ Built-In Assembly Language Support for Turbo Pascal Compilers ═══════
The following is a brief description of the new features in
Release 2:
Version 5.0 and v5 TPC are now supported along with Version 4.0
and v4 TPC. Version 3 compilers are no longer supported.
With Version 5.0, you can trace (F7 Trace into, F4 Go to cursor,
etc) your assembly code in the turbo integrated debugger. The unit
ASMWATCH.TPU, included, defines the record variable CPU which permits
you to Watch, Evaluate, and Modify the state of all CPU registers and
Flags as you Trace. Simply include the statement "Uses ASMWATCH;" at
the start of your program. The following Watch expressions are
particularly useful:
CPU.CsIp,p - Segment:Offset of the current instruction
CPU.CsIp^,m - Hex Dump beginning at current instruction
CPU.Flags-On - Current state of CPU Flags
CPU.SsSp,P - Segment:Offset of the Stack Pointer
W(CPU.SsSp^),$ - Memory Dump at current Stack Pointer
CPU,$R - Lists all register names and contents
CPU.Si,$ (etc) - List contents of any Byte or Word Register
In addition, MAP files produced with both Version 4.0 and 5.0
compilers contain Line Number detail for all assembly sections
(Except Inline/Assembly DIRECTIVES), permitting source level
debugging in any MAP-file compatible debugger.
You can now specify any valid Pascal Label as the target of an
Assembly Call, Jmp, Loop, or conditional jump. As with the Pascal
"Goto" statement, the label must be defined in the current block.
You can now specify an assembly label as the target of a Pascal
"Goto" statement. The target label must be declared in a standard
Pascal "Label" statement.
The Keyword "Assembly" can now be used in place of "Assemble".
This is useful to avoid misleading constructions like:
IF <Pascal Condition> THEN Assemble
which gives the false impression of conditional assembly. True
conditional assembly is possible as described below. Conditional
execution of an assembly block is more clearly indicated by:
IF <Pascal Condition> THEN Assembly
Assembly blocks can now be used in full Pascal conditional
expressions, eg:
IF Compiler.Ver = $50 THEN Assembly
< Assembly language statements >
END ELSE Assembly
< Assembly language statements >
END;
To permit this, the final "End" must now be a valid PASCAL
statement, eg "END; {Assemble}" rather than "END Assemble;"
There is a new keyword "Asm" for concisely specifying single line
assembly statements, eg:
Asm Push PascalVar; {Save PascalVar on Stack}
The Asm statement should end with ";" unless there is a subsequent
"ELSE" clause. The remainder of the line must be blank except that
a comment is permitted after the ";". The following is valid:
IF BytePointer^ <> 0 THEN Asm Call PasLabel
ELSE Asm Inc ZeroCount; {Comment permitted here}
There is a new Assembly Keyword "Pas" for inserting single or
multiple line Pascal statements within an assembly section, eg:
Pas WRITELN('Compiled with Turbo Pascal Version ',
Pas {$IFDEF VER40} '4.0' {$ELSE} '5.0' {$ENDIF} );
This permits true conditional assembly by placing a section of
assembly statements between "Pas {$IFDEF ..}" and "Pas {$ENDIF}".
You can now make direct calls to Pascal Procedures and Functions
defined in any standard or user-defined program or Unit. There
is no longer any need to set up an intermediate variable containing
the Proc/Function address. Note however that "System" Procedures
and Functions do not use true PROC Calls and therefore cannot
be called from assembly language, either directly or indirectly.
Use the "Pas" statement, above, to "Call" System Proc/Functions.
TP&Asm now performs automatic Jump-Sizing for all backward AND
FORWARD Jumps and Loops (Jmp, jZ, jAE, jCXZ, Loop, LoopNZ, etc).
3, 5, or 7 byte instruction sequences are automatically generated
if the target label is not within range of a 2 byte instruction.
This includes automatic shortening of unconditional jumps ...
Jmp CloseBy .. becomes .. Jmp Short CloseBy ;2 bytes
... automatic 5 byte "IF <Cond> Jmp" for backward AND FORWARD
conditional jumps out of range ...
jNZ FarAway .. becomes .. jZ >L0 ;2 bytes
Jmp FarAway ;3 bytes
L0:
... and automatic 7 byte instruction sequences for backward AND
FORWARD jCXZ & Loop's out of range ...
Loop FarAway .. becomes .. Loop >L0 ;2 bytes
Jmp Short >L1 ;2 bytes
L0: Jmp FarAway ;3 bytes
L1:
TP&Asm does NOT pad forward jumps with NOP instructions - it
will always build the smallest possible instruction.
(The automatic Jump-Sizing feature is not enabled in Inline/Assembly
DIRECTIVES. As described in the Turbo 4.0 and 5.0 manuals, Inline
Directives are intended for short sections of code which are unlikely
to exceed 127 bytes. TP&Asm generates an error if a conditional jump
out of range is attempted in an Inline/Assembly Directive).
There is a new KeyWord "CSDATA" for allocating "Global" CSeg data
which can be used throughout the current Unit. Alternately, the FIRST
procedure in a Unit or Program can allocate "LOCAL" CSeg data which
can be used throughout the procedure. There is no longer any need
to specify an offset ("Offset-Indexed CSegs").
The construct "SEG Data" is now supported to facilitate restoring
the Turbo Program Data Segment in a user written interrupt procedure:
Mov Ax,SEG Data
Mov Ds,Ax
"Register-Indexed CSegs" are no longer supported. The preceding
two alternatives make them unnecessary.
Your source files will require the following changes:
Make sure that the "End" statement which terminates each assembly
section is a valid PASCAL Statement. Thus, "END Assemble;" is no
longer valid - use "END; {Assembly}" (or "END {Assembly}" if there
is a subsequent "ELSE" clause).
"Register-Indexed CSegs" are no longer supported. Use CsData or
restore the Data Segment with "SEG Data".
The archive file TP-TSR contains a set of files which implement
a sample Stay-Resident application using an interrupt Unit compiled
with TP&Asm. The Unit DOS21_0A, in particular, illustrates the use
of the new CsData Statement.
The file DEMONEW.PAS illustrates a number of the other new features
described above. Set the Watch Expressions as described and Trace
(F7: Trace into) in the Turbo 5.0 integrated debugger.